//
// Created by denglibin on 2021/5/25.
// 描述wav格式

#ifndef FFMPEG_WAV_FORMAT_H
#define FFMPEG_WAV_FORMAT_H
//wav的头部第一部分
typedef struct wav_header{
    char chunkId[4];//4字节的chunk id
    unsigned long chunkSize; //文件长度4字节
    char format[4];//格式 4字节
}WavHeader;

//wav的头部第二部分,文件的采样率，码率，通道数等 fmt sub-chunk
typedef struct wav_fmt{
    char subChunk1Id[4]; //4字节
    unsigned long subChunk1Size; //4字节
    unsigned short audioFormat; //2字节
    unsigned short channels;//2字节 通道数
    unsigned long sampleRate; //4字节 采样率
    unsigned long bitRate; //4字节码率

    unsigned short blockAlign;
    unsigned short bitPerSample;
}WavFmt;

//wav的头部第三部分 data sub-chunk
typedef struct wav_data{
    char subChunk2Id[4];
    unsigned long subChunk2Size;

}WavData;

#endif //FFMPEG_WAV_FORMAT_H
